package db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @auther 郭天凌
 * @date 2022/3/9
 */
public class mysqldb {

    private final static String DB_driver="com.mysql.cj.jdbc.Driver";
    private final static String DB_user="root";
    private final static String DB_url="jdbc:mysql://localhost:3306/mysql?&useSSL=false&serverTimezone=UTC";
    private final static String DB_password="123456";

    public Connection getConn(){

         Connection conn=null;

        try {
            Class.forName(DB_driver);
            conn = DriverManager.getConnection(DB_url,DB_user,DB_password);
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    return  conn;
    }



}
